package com.cd.music.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * @author yxl 余秀良
 * @version 1.0
 * @description: 用户登录实体类
 * @date 2018年02月07日 下午3:51
 * @address: 四川成都
 */
@Entity
@Table(name = "UserLogin")
public class UserLogin implements Serializable {
    private static final long serialVersionUID = -7067086329140247454L;
    /**
     * 主键id
     */
    @Id
    @Column(nullable = false, unique = true, length = 32)
    private String id;
    /**
     * 用户id
     */
    @Column(name = "userId", length = 32, nullable = false)
    private String userId;
    /**
     * 创建时间
     */
    @Column(name = "createTime", columnDefinition = "datetime default now()")
    private Date createTime;
    /**
     * 登录状态
     */
    @Column(name = "loginStatus", length = 1, columnDefinition = "tinyint(1) default 0")
    private int loginStatus;
    /**
     * 密码
     */
    @Column(length = 30, nullable = false, name = "password", columnDefinition = "nvarchar(30) default '123456'")
    private String password;
    /**
     * 身份令牌
     */
    @Column(nullable = false, columnDefinition = "LONGTEXT not null")
    private String token;
    /**
     * 帐号状态 0：账号正常；1：账号异常；-1：禁止登录；
     */
    @Column(name = "accountStatus", length = 1, columnDefinition = "tinyint(1) default 0")
    private int accountStatus;
    /**
     * 备注
     */
    @Column(name = "remark", length = 200)
    private String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getCreateTime() {
        return createTime != null ? (Date) createTime.clone() : null;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime != null ? (Date) createTime.clone() : null;
    }

    public int getLoginStatus() {
        return loginStatus;
    }

    public void setLoginStatus(int loginStatus) {
        this.loginStatus = loginStatus;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public int getAccountStatus() {
        return accountStatus;
    }

    public void setAccountStatus(int accountStatus) {
        this.accountStatus = accountStatus;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}